﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace projetSupinfoBFG.Base
{
    class Sprite
    {
        protected Vector2 position;
        protected Texture2D texture;
        
        public Sprite(Vector2 position)
        {
            this.position = position;
        }
        
        public Sprite(float x, float y)
        {
            position = new Vector2(x, y);
        }

        public void LoadContent(string assetName)
        {
            texture = TextureManager.GetInstance().GetTexture(assetName);
        }
        
        public virtual void Update(Vector2 translation)
        {
            position += translation;
        }
        
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, Color.White);
        }
    }
}
